home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / cprod3d.z / cprod3d
Encoding:
Text File  |  1998-10-30  |  8.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccpppprrrroooodddd3333dddd,,,,zzzzpppprrrroooodddd3333dddd((((3333FFFF))))                                        ccccpppprrrroooodddd3333dddd,,,,zzzzpppprrrroooodddd3333dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccpppprrrroooodddd3333dddd,,,, zzzzpppprrrroooodddd3333dddd ---- Compute the product of a 3D Fourier transforms with a
  10.      3D filter.
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  13.      _F_o_r_t_r_a_n :
  14.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccpppprrrroooodddd3333dddd(((( nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,aaaarrrrrrrraaaayyyy,,,,llllaaaa1111,,,,llllaaaa2222,,,,ffffiiiilllltttteeeerrrr,,,,llllffff1111,,,,llllffff2222))))
  15.      iiiinnnntttteeeeggggeeeerrrr   nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,llllaaaa1111,,,,llllaaaa2222,,,,llllffff1111,,,,llllffff2222
  16.      ccccoooommmmpppplllleeeexxxx   aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333)))),,,, ffffiiiilllltttteeeerrrr((((llllffff1111,,,,llllffff2222,,,,nnnn3333))))
  17.  
  18.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzpppprrrroooodddd3333dddd(((( nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,aaaarrrrrrrraaaayyyy,,,,llllaaaa1111,,,,llllaaaa2222,,,,ffffiiiilllltttteeeerrrr,,,,llllffff1111,,,,llllffff2222))))
  19.      iiiinnnntttteeeeggggeeeerrrr   nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,llllaaaa1111,,,,llllaaaa2222,,,,llllffff1111,,,,llllffff2222
  20.      ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx      aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333)))),,,, ffffiiiilllltttteeeerrrr((((llllffff1111,,,,llllffff2222,,,,nnnn3333))))
  21.  
  22.  
  23.      _C :
  24.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  25.      iiiinnnntttt ccccpppprrrroooodddd3333dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,,ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllaaaa1111,,,,
  26.           iiiinnnntttt llllaaaa2222,,,, ccccoooommmmpppplllleeeexxxx ****ffffiiiilllltttteeeerrrr,,,, iiiinnnntttt llllffff1111,,,, iiiinnnntttt llllffff2222))));;;;
  27.      iiiinnnntttt zzzzpppprrrroooodddd3333dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,,zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllaaaa1111,,,,
  28.            iiiinnnntttt llllaaaa2222,,,, zzzzoooommmmpppplllleeeexxxx ****ffffiiiilllltttteeeerrrr,,,, iiiinnnntttt llllffff1111,,,, iiiinnnntttt llllffff2222))));;;;
  29.  
  30.  
  31. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  32.      ccccpppprrrroooodddd3333dddd and zzzzpppprrrroooodddd3333dddd compute the product of the Fourier transforms of 3D
  33.      complex sequence (size N1xN2xN3) with the Fourier transform of 3D filter.
  34.      Note, the product of the Fourier transforms of two sequences is equal to
  35.      the Fourier transform of their convolution.
  36.  
  37.  
  38. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  39.      NNNN1111 Integer, the first dimension size of the 3D sequence.
  40.      Unchanged on exit.
  41.  
  42.      NNNN2222 Integer, the second dimension size of the 3D sequence.
  43.              Unchanged on exit.
  44.  
  45.      NNNN3333 Integer, the thrid dimension size of the 3D sequence.
  46.              Unchanged on exit.
  47.  
  48.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 3D sequence to be transformed.
  49.      On input, the element {i,j,k} of the sequence is stored as A(i,j,k) in
  50.      _F_o_r_t_r_a_n , and A[i+j*la1+k*la1*la2] in _C.
  51.      On exit, the array is overwritten.
  52.  
  53.      LLLLAAAA1111 Integer, first leading dimension: increment between the samples of
  54.      two consecutive 1D sub-sequences (e.g between {i,j+1,k} and {i,j,k} ).
  55.      Unchanged on exit.
  56.  
  57.      LLLLAAAA2222 Integer, second leading dimension: number of the 1D sub-sequence
  58.      between two consecutive 2D sub-sequences (e.g between {i,j,k+1} and
  59.      {i,j,k}).  Unchanged on exit.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccpppprrrroooodddd3333dddd,,,,zzzzpppprrrroooodddd3333dddd((((3333FFFF))))                                        ccccpppprrrroooodddd3333dddd,,,,zzzzpppprrrroooodddd3333dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      FFFFIIIILLLLTTTTEEEERRRR Array containing the Fourier Transform of the 3D filter.
  75.      Unchanged on exit.
  76.  
  77.      LLLLFFFF1111 Integer, filter array first leading dimension.  Unchanged on exit.
  78.  
  79.      LLLLFFFF2222 Integer, filter array second leading dimension.  Unchanged on exit.
  80.  
  81.  
  82. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  83.      Given a real sequence of size 100x64x125.  We apply successvely the
  84.      Direct FFT, the Inverse FFT, and scale back.  The elements of each
  85.      sequence are stored with increment (stride) 1,
  86.      _F_o_r_t_r_a_n
  87.           complex array(0:100-1,0:64-1,0:125-1)
  88.           complex filter(0:100-1,0:64-1,0:125-1),
  89.           complex coeff(100+15 + 64+15 + 125+15)
  90.           call cfft3di( 100, 64, 125, coeff)
  91.           call cfft3d( -1, 100, 64, 125, array, 100, 64, coeff)
  92.           ccccaaaallllllll ccccpppprrrroooodddd3333dddd(((( 111100000000,,,,66664444,,,,111122225555,,,,aaaarrrrrrrraaaayyyy,,,,111100000000 ,,,,66664444,,,,ffffiiiilllltttteeeerrrr,,,,111100000000,,,,66664444))))
  93.           call cfft3d(  1, 100, 64, 125, array, 100, 64, coeff)
  94.  
  95.      _C
  96.           #include <fft.h>
  97.           complex array[100*64*125], filter[100*64*125], *coeff;
  98.           coeff = cfft3di( 100, 64, 125, NULL);
  99.           cfft3d( -1, 100, 64, 125, array, 100, 64, coeff);
  100.           ccccpppprrrroooodddd3333dddd(((( 111100000000,,,, 66664444,,,, 111122225555,,,, aaaarrrrrrrraaaayyyy,,,, 111100000000,,,, 66664444,,,, ffffiiiilllltttteeeerrrr,,,, 111100000000))));;;;
  101.           cfft3d( -1, 100, 64, 125, array, 100, 64, coeff);
  102.  
  103.      NNNNOOOOTTTTEEEE :::: As the FFTs are not normalized, a successive direct, then inverse
  104.      transform, scales the original input by the size of the sequence. Rather
  105.      than calling cscal3d or zscal3d to scale back the result, this scaling
  106.      factor could be directly applied to the filter transform, thus saving
  107.      some extra work.
  108.  
  109. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  110.      fft, cfft3di, zfft3di, cfft3d, zfft3d, cscal3d, zscal3d
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.